#ifndef __MCS__COE_PARSER__HPP
#define __MCS__COE_PARSER__HPP

#include "ParserDefines.hpp"
#include "InputStream.hpp"

class CodeParser : public Object
{
public:
	enum CodeBlockType
	{
		OutsideCodeBlock,
		InLineBlock,
		EndOfLineBlock,
		MultiLineBlock,
	};

	CodeParser(InputStream * stream);
	~CodeParser();

	int parseNext();

	ObjectPtr value() const { return value_; }
	SourceLocation location() const { return location_; }
private:
	InputStream * stream_;
	ObjectPtr value_;
	SourceLocation location_;

	int parseSpaces();
	int parseName();
	int parseString();
	int parseNumber();
	int parseOperator();
};

#endif //__MCS__COE_PARSER__HPP
